﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Icoders.MarketTracker.Core.Repository.Transaction;
using Icoders.MarketTracker.Web.Lib.Command.Transactions.Orders;

namespace Icoders.MarketTracker.Web.Lib.CommandHandler.Orders.Impl
{
   public class ConfirmOrderCommandHandler : IConfirmOrderCommandHandler
    {
        private IPurchaseOrderRepository _purchaseOrderRepository;

        public ConfirmOrderCommandHandler(IPurchaseOrderRepository purchaseOrderRepository)
       {
           _purchaseOrderRepository = purchaseOrderRepository;
       }
        public void Execute(ConfirmOrderCommand cmd)
        {
            try
            {
                _purchaseOrderRepository.Confirm(cmd.DocId);
            }
            catch (Exception ex)
            {
                throw ex;

            }
        }
    }
}
